<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Array2Table div Demo</title>
<style type="text/css">

.att .hcol {border: 2px solid #bbbbbb;}
.att .col {border: 1px solid #cccccc;}
.att .fcol {border: 1px solid #000000;}
.att .specclass {border: 2px solid red;}
.att .something {background:#aaaaff;}
.att #tolleid {background:#ffaaaa;}
</style>
</head>

<body>
<h2>Example for rowspan and Colspan</h2>
<p>You can add an array whith additional data inside of a data element.</p> <br /> 

"class" =&gt; spezielle classen die nur für dieses element gesetzt werden<br />
"extra" =&gt; text for additional  html attributes for this element  <br />
"value" =&gt; the actual value of this element <br /> <br /> 

"colspan" =&gt; auto create empty arrays for colspan and add extra attribut(not implemented yet) <br />
"rowspan" =&gt; auto create empty arrays for colspan and add extra attribut(not implemented yet) <br />

<p>Elements that contain empty arrays are not rendered.</p>
<p>Its not necessary to </p>
  <br /> <br />  <br /> 
<?php
// Data Header and Footer in different arrays.
// this is the basic setting
$aData = array( 
               array("Name",                                                                                                      "Price", "Number", "Description"),
               array("rose",                                                                                                        1.25 ,       15,    "sometext"),
               array(array("class"=>"specclass something","extra"=>'id="tolleid" colspan="2" rowspan="2"',"value"=>"Orchid"),    array() ,       25,    "moretext"),
               array(array(),                                                                                                    array() ,        7,    "evenmore"),
               array("rose2",                                                                                                       1.25 ,       15,    "sometext"),
               array("daisy3",                                                                                                      0.75 ,       25,    "moretext"),
               array(array("class"=>"something","extra"=>'colspan="3" rowspan="3"',"value"=>"Orchid"),              array() ,  array(),    "evenmore"), 
               array(array() ,                                                                                                   array() ,  array(),    "sometext"),
               array(array() ,                                                                                                   array() ,  array(),    "moretext"),
               array("orchid4",                                                                                                     1.15 ,        7,    "evenmore"), 
               array("fName",                                                                                                    "fPrice","fNumber","fDescription")
             ); 

// include the Script
include ("classes/arraytotable.php");

// create new tableobject
$oAtt=new ArrayToTable();

// set the main Data Array
$oAtt->aData =$aData;

// fetch header and Footer from first and last row
$oAtt->sHeadAutoFetch = "first";
$oAtt->sFootAutoFetch = "last";


// Do the actual job
echo ($oAtt->Create());

//thats it 



?>
</body>
</html>